<?php
namespace Common\Models;
use Common\BaseModel;
class BShopGoodsCategory extends BaseModel
{
    public $res;
    public $expire;
    public function initialize()
    {
        parent::initialize();
        $this->setSource('b_shop_goods_category');
    }
    public function goods_categories_parents($pid=0)
    {
        $condition = "p_id = {$pid}";
        $all       = $this::find(
            array(
                $condition,
                "order"   => 'id asc',
                "columns" => 'id,category_name',
            )
        )->toarray();
        return $all;
    }
}
